package demo.demo05.test07;

public class APP {
    private static java.lang.Object Object;
//   x   instanceof    y          中xy必须要有父子关系
    public static void main(String[] args) {
        Object object = new Student();
        System.out.println(Object instanceof Person);//true
        System.out.println(Object instanceof Student);//true
        System.out.println(Object instanceof Object);//true
        System.out.println(Object instanceof Teacher);//false
        System.out.println(Object instanceof String);//false

        Student student = new Student();

        System.out.println(student instanceof Person);//true
        System.out.println(student instanceof Student);//true
//        System.out.println(student instanceof Teacher);//false
//        System.out.println(student instanceof String);//false

        Person person = new Student();
        System.out.println(person instanceof Person);//true
        System.out.println(person instanceof Student);//true
        System.out.println(person instanceof Object);//true
        System.out.println(person instanceof Teacher);//false
//        System.out.println(person instanceof String);//false
    }

}
